package com.linkallcloud.deapi;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

public class DeLog {

    @Id
    @Field(type = FieldType.Keyword, name = "id")
    private String id;// 消息ID（es生成）

    /**
     * 前后台统一TID
     */
    @Field(type = FieldType.Keyword, name = "doc.tid")
    private String tid;// 前后台统一TID

    @Field(type = FieldType.Keyword, name = "doc.bid")
    private String bid;// 业务id

    @Field(type = FieldType.Keyword, name = "doc.direction")
    private String direction;// Request,Response

    @Field(type = FieldType.Keyword, name = "doc.sender")
    private String sender;

    @Field(type = FieldType.Keyword, name = "doc.receiver")
    private String receiver;

    @Field(type = FieldType.Date, name = "doc.dt", format = DateFormat.date_optional_time,
            pattern = "yyyy-MM-dd HH:mm:ss")
    protected String dt; // 操作时间

    @Field(type = FieldType.Long, name = "doc.cost")
    private Long cost;// 操作花费时间

    @Field(type = FieldType.Keyword, name = "doc.resultCode")
    private String resultCode;

    @Field(type = FieldType.Text, name = "doc.request")
    private String request;

    @Field(type = FieldType.Text, name = "doc.response")
    private String response;

    @Field(type = FieldType.Keyword, name = "doc.logLevel")
    private String logLevel;

    @Field(type = FieldType.Keyword, name = "doc.domain")
    private String domain;

    public DeLog() {
        super();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getBid() {
        return bid;
    }

    public void setBid(String bid) {
        this.bid = bid;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getDt() {
        return dt;
    }

    public void setDt(String dt) {
        this.dt = dt;
    }

    public Long getCost() {
        return cost;
    }

    public void setCost(Long cost) {
        this.cost = cost;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public String getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(String logLevel) {
        this.logLevel = logLevel;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

}
